﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Onshi.POS.Formularios.Recursos
{
    public class EtiquetaBase : Label
    {
        #region Constructores

        public EtiquetaBase()
        {
            HandleCreated += new EventHandler(EtiquetaBase_HandleCreated);
        }

        #endregion

        #region Atributos

        private Boolean esRequerido = false;

        #endregion

        #region Propiedades

        public Boolean EsRequerido
        {
            get { return esRequerido; }
            set
            {
                esRequerido = value;
                ValidarColores();
            }
        }

        #endregion

        #region Metodos

        private void ValidarColores()
        {
            if (esRequerido)
                ForeColor = Color.Red;
            else
                ForeColor = Color.Black;
        }

        #endregion

        #region Eventos

        private void EtiquetaBase_HandleCreated(Object sender, EventArgs e)
        {
            //Font = Properties.Settings.Default.Fuente;
            ValidarColores();
        }

        #endregion
    }
}
